import request from '@/utils/request'
import qs from 'qs'


export function pub_scan(cursor,match,size,page_size) {
  return request({
    url: '/api/key/pub/scan',
    method: 'post',
    data: qs.stringify({
      cursor,match,size,page_size
    })
  })
}


export function pub_rename(key,new_key,cover) {
  return request({
    url: '/api/key/pub/rename',
    method: 'post',
    data: qs.stringify({
      key,new_key,cover
    })
  })
}

export function pub_expire(key,ttl) {
  return request({
    url: '/api/key/pub/expire',
    method: 'post',
    data: qs.stringify({
      key,ttl
    })
  })
}

export function pub_persist(key) {
  return request({
    url: '/api/key/pub/persist',
    method: 'post',
    data: qs.stringify({
      key
    })
  })
}
export function pub_selectDb(db) {
  return request({
    url: '/api/key/pub/selectDb',
    method: 'post',
    data: qs.stringify({
      db
    })
  })
}

export function pub_keyType(key) {
  return request({
    url: '/api/key/pub/getKeyType',
    method: 'post',
    data: qs.stringify({
      key
    })
  })
}


